"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
var api_1 = require("../../../config/api");
var http_1 = require("@angular/http");
var CategoryService = /** @class */ (function () {
    function CategoryService(httpService) {
        this.httpService = httpService;
    }
    // 类目
    CategoryService.prototype.delCategory = function (id) {
        var url = api_1.tuikeSystemUrl + "/api/v1/admin/category/delete_category";
        var headers = new http_1.Headers({ 'Content-Type': 'application/json' });
        var options = new http_1.RequestOptions({ headers: headers });
        var body = JSON.stringify({ id: id });
        return this.httpService.httpPostAuth(url, body, options).map(function (rs) { return rs; });
    };
    CategoryService.prototype.getCategoryList = function (level, parent) {
        var url = api_1.tuikeSystemUrl + "/api/v1/admin/category/category_list?level=" + level + "&parent_id=" + parent + "&pageSize=200";
        return this.httpService.httpGetAuth(url).map(function (res) { return res; });
    };
    CategoryService = __decorate([
        core_1.Injectable()
    ], CategoryService);
    return CategoryService;
}());
exports.CategoryService = CategoryService;
